using System;
using System.Collections.Generic;
using System.Text;
using Danser_Entity;
using Danser_Entity.Entities;
using Danser_Entity.Queries.Filters;
using Danser_Entity.Queries.Data;

namespace Danser_Control.Managers
{
    /// <summary>
    /// Expose capabilities of performing data queries upon the Danser data base entities
    /// </summary>
    public interface IQueryManager
    {
        /// <summary>
        /// Retrieves tests' info from DB to disply in the UI according to a specified filter expression
        /// </summary>
        /// <param name="filter">filter expression according the parameters available
        /// if filter is null or empty returns all tests in DB</param>
        /// <returns></returns>
        IList<TestInfo> GetTests(String filter);

        /// <summary>
        /// Retrieves tests' results from DB to display in the UI according to a specified filter expression
        /// </summary>
        /// <param name="filter">filter expression according the test parameters available.
        /// if filter is null or empty - displays all results of the selected test</param>
        /// <returns></returns>
        IList<TestResults> GetTestResults(String filter);

        /// <summary>
        /// Returns a list of TestIntegratedData that applies to given rule
        /// </summary>
        /// <param name="rule"></param>
        /// <returns></returns>
        IList<TestIntegratedData> GetTestData(String rule);

        /// <summary>
        /// Builds a the visual display of a selected test results
        /// </summary>
        /// <param name="results"></param>
        /// <param name="yAxis"></param>
        void BuildGraph(TestResults results, IList<String> yAxis);

        /// <summary>
        /// Saves a favorite query in DB, and binds it to the user
        /// </summary>
        /// <param name="queryName"></param>
        /// <param name="queryDescription"></param>
        /// <param name="queryString"></param>
        /// <param name="userID">The user to bind the query to</param>
        void SaveQuery(String queryName, String queryDescription, String queryString, String userID);

        /// <summary>
        /// Gets a favorite queryString according to name
        /// </summary>
        /// <param name="userID"></param>
        /// <param name="queryId"></param>
        /// <returns>The queryString</returns>
        UserQuery GetUserSpecificQuery(String userID, int queryId);

        /// <summary>
        /// Gets all the representing strings of the favorite queries of the given user
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        IList<UserQuery> GetUserFavoriteQueries(String userID);
    }
}
